﻿<CodeSnippetTabbed DocLink="https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxDataGrid-1#filter-data">
    <CodeSnippetTabPage Text="Razor">@(@"<DxDataGrid Data=""@Orders""
            ShowFilterRow=""true""
            CssClass=""mw-1100"">
    <DxDataGridDateEditColumn Field=""@nameof(Order.OrderDate)""
                              DisplayFormat=""D""
                              Width=""240px"">
    </DxDataGridDateEditColumn>
    <DxDataGridComboBoxColumn Field=""@nameof(Order.CountryId)""
                              Caption=""Ship Country""
                              Data=""@Countries""
                              ValueFieldName=""@nameof(Country.Id)""
                              TextFieldName=""@nameof(Country.CountryName)""
                              FilteringMode=""DataGridFilteringMode.Contains""
                              Width=""250px"">
    </DxDataGridComboBoxColumn>
    <DxDataGridSpinEditColumn Field=""@nameof(Order.UnitPrice)""
                              DisplayFormat=""c""
                              Width=""120px"">
    </DxDataGridSpinEditColumn>
    <DxDataGridColumn Field=""@nameof(Order.Product)"">
    </DxDataGridColumn>
    <DxDataGridCheckBoxColumn Field=""@nameof(Order.OrderStatus)""
                              FilterTextChecked=""Delivered""
                              FilterTextUnchecked=""Processing""
                              FilterTextIndeterminate=""In transit""
                              ValueChecked=""@OrderStatus.Delivered""
                              ValueUnchecked=""@OrderStatus.Processing""
                              ValueIndeterminate=""@OrderStatus.InTransit""
                              Caption=""Order Status"">
    </DxDataGridCheckBoxColumn>
    <DxDataGridCommandColumn NewButtonVisible=""false""
                             EditButtonVisible=""false""
                             DeleteButtonVisible=""false""
                             Width=""70px"">
    </DxDataGridCommandColumn>
</DxDataGrid>

@code {
    IEnumerable<Order> Orders;
    IEnumerable<Country> Countries;

    protected override async Task OnInitializedAsync()
    {
        Countries = await CountryNamesService.LoadAsync();
        Orders = await OrderRepository.Load();
    }
}")</CodeSnippetTabPage>
</CodeSnippetTabbed>
